import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";

@Index("card_no", ["cardNo"], { unique: true })
@Entity("iot_sim", { schema: "frog_charge" })
export class IotSim {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("varchar", { name: "card_no", unique: true, length: 20 })
  cardNo: string;

  @Column("int", { name: "expire_in", unsigned: true, default: () => "'0'" })
  expireIn: number;

  @Column("int", { name: "device_id", unsigned: true, default: () => "'0'" })
  deviceId: number;

  @Column("int", { name: "update_time", unsigned: true, default: () => "'0'" })
  updateTime: number;

  @Column("int", { name: "create_time", unsigned: true, default: () => "'0'" })
  createTime: number;
}
